#!/usr/bin/env php
<?php
/**
 * KayPaste
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.opensource.org/licenses/bsd-license.php
 *
 * @category  KayPaste
 * @package   KayPaste_Cli
 * @copyright Copyright (c) 2007-2008 Robin Skoglund (http://robinsk.net/)
 * @license   http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @author    Robin Skoglund
 */

/**
 * Bootstrap
 */
require dirname(dirname(dirname(__FILE__))) . '/application/bootstrap.php';

/**
 * Run application in CLI mode
 */
Zym_App::run(PATH_PROJECT . 'application/config/bootstrap.xml', 'cli');

/**
 * The Doctrine resource is required
 */
if (!$resource = Zym_App::getInstance()->getResource('doctrine')) {
    exit("Application does not have Doctrine resource.\n");
}

/**
 * Instantiate and run Doctrine CLI
 */
$cli = new Doctrine_Cli($resource->getPathConfig());
$cli->run($_SERVER['argv']);
